package org.ccay.log.connection.impl;

import org.ccay.core.log.CcayLoggerFactory;
import org.ccay.core.log.ILogger;

/**
 * ConnectionLog开关 状态管理器
 * @author chaowangbang
 * @since 2013-03-15
 */
public final class ConnectionLogStatusManager {
	private static final ILogger log = CcayLoggerFactory.getLogger(ConnectionLogStatusManager.class);
	
	private static final ConnectionLogStatusManager instance = new ConnectionLogStatusManager();
	
	private static boolean logEnabled = false;
	
	/** 
	 * 获取唯一实例
	 * @return
	 */
	public static ConnectionLogStatusManager getInstance(){
		return instance;
	}
	
	/**
	 * 避免实例
	 */
	private ConnectionLogStatusManager(){
		
	}

	/**
	 * @return the isLogEnabled
	 */
	public static boolean isLogEnabled() {
		return logEnabled;
	}

	/**
	 * Set 
	 * @param isLogEnabled the isLogEnabled to set
	 */
	public static void setLogEnabled(boolean logEnabled) {
		
		ConnectionLogStatusManager.logEnabled = logEnabled;
		log.debug("[ConnectionLogStatusManager.logEnabled=]"+ConnectionLogStatusManager.logEnabled);
	}
	
	
}
